package com.tx.dao;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import com.tx.pojo.Employee;
import com.tx.pojo.User;

public class Main2 {
	public static void main(String[] args) throws IOException {
		
		String resource = "conf.xml";
		InputStream inputStream = Resources.getResourceAsStream(resource);
		SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
		SqlSession session = sqlSessionFactory.openSession();
		UserDAO dao =session.getMapper(UserDAO.class);
		User emp =dao.selectUserById(2);		
		System.out.println(emp);
		session.close();	

	}

}
